package com.maverick.guardianangel;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;

public class GuardianAngel extends Activity implements OnClickListener{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        View waiButton = this.findViewById(R.id.wai_button);
        waiButton.setOnClickListener(this);
        View wdtsButton = this.findViewById(R.id.wdts_button);
        wdtsButton.setOnClickListener(this);
        View wdoestsButton = this.findViewById(R.id.wdoests_button);
        wdoestsButton.setOnClickListener(this);
        View historyButton = this.findViewById(R.id.history_button);
        historyButton.setOnClickListener(this);
        View helpButton = this.findViewById(R.id.help_button);
        helpButton.setOnClickListener(this);
        View aboutButton = this.findViewById(R.id.about_button);
        aboutButton.setOnClickListener(this);
        
    }
    
    public void onClick(View v)
    {
    	switch(v.getId()) {
    	case R.id.wai_button:
    		Intent i1 = new Intent(this, WhereAmI.class);
    		startActivity(i1);
    		break;
    	case R.id.wdts_button:
    		Intent i2 = new Intent(this, WhatDidTheySay.class);
    		startActivity(i2);
    		break;
    	case R.id.history_button:
    		Intent i3 = new Intent(this, History.class);
    		startActivity(i3);
    		break;
    	case R.id.help_button:
    		Intent i4 = new Intent(this, Help.class);
    		startActivity(i4);
    		break;
    	case R.id.about_button:
    		Intent i5 = new Intent(this, AboutUs.class);
    		startActivity(i5);
    		break;
    	case R.id.wdoests_button:
    		Intent i6 = new Intent(this, WhatDoesThisSay.class);
    		startActivity(i6);
    		break;
    	}
    }
    
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.main, menu);
        return true;
    }
    
    public boolean onOptionsItemSelected(MenuItem item) { 
        switch (item.getItemId()) {
            case R.id.item01:    
                // Toast.makeText(this, "You pressed Gallery!", Toast.LENGTH_LONG).show();          
                //Toast.makeText(this, "You pressed Exit!", Toast.LENGTH_LONG).show();          
                System.exit(0);                 
                break;
        }
        return true;
    }
}